﻿@model CPRApp.Models.BookingModels

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

    
<script type="text/javascript">
    $(document).ready(function () {

        $('.date').datepicker();
        $(".dateTime").timepicker({ 'scrollDefaultNow': true, 'timeFormat': 'H:i:s' });
        $('#setStartTimeButton').on('click', function () {
            $('#WorkStartTime').timepicker('setTime', new Date());
        });
    });
</script>

@{
    ViewBag.Title = "Cell Phone Repair Booking";
}

<h2>Cell Phone Repair Booking</h2>
<p>
    Use the form below to create new Cell Phone Repair Booking. 
</p>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true, "Booking creation was unsuccessful. Please correct the errors and try again.")
    <div class="FormContents">
        <fieldset>
            <legend>Booking Information</legend>
            <div class="editor-label">
                @Html.LabelFor(m => m.BookingId)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.BookingId)
                @Html.ValidationMessageFor(m => m.BookingId)
            </div>
        </fieldset>
        <div class="fieldsSection">
            <fieldset>
                <legend>Booking Information</legend>

                <div class="editor-label">
                    @Html.LabelFor(m => m.ReceiptDate)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.ReceiptDate, new { @class = "date", id = "ReceiptDate", @Value = "03/13/2013" })
                    @Html.ValidationMessageFor(m => m.ReceiptDate)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(m => m.CustomerName)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.CustomerName)
                    @Html.ValidationMessageFor(m => m.CustomerName)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(m => m.ItemModel)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.ItemModel)
                    @Html.ValidationMessageFor(m => m.ItemModel)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(m => m.ItemDetails)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.ItemDetails)
                    @Html.ValidationMessageFor(m => m.ItemDetails)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(m => m.ItemCondition)
                </div>
               @* <div class="editor-field">
                    @Html.ListBoxFor(m => m.ItemCondition, new MultiSelectList(Model.ConditionsList))
                    @Html.ValidationMessageFor(m => m.ItemCondition)
                </div>*@

                <div class="editor-label">
                    @Html.LabelFor(m => m.EstimateDeliveryTime)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.EstimateDeliveryTime, new { @class = "dateTime", id = "EstimateDeliveryTime" })
                    @Html.ValidationMessageFor(m => m.EstimateDeliveryTime)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(m => m.EstimateBillAmount)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.EstimateBillAmount)
                    @Html.ValidationMessageFor(m => m.EstimateBillAmount)
                </div>

               @* <div class="editor-label">
                    @Html.LabelFor(m => m.EntryTime)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.EntryTime)
                    @Html.ValidationMessageFor(m => m.EntryTime)
                </div>*@

                <div class="editor-label">
                    @Html.LabelFor(m => m.IssuesReported)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.IssuesReported)
                    @Html.ValidationMessageFor(m => m.IssuesReported)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(m => m.IsInWarrenty)
                </div>
                <div class="editor-field">
                    @Html.CheckBoxFor(m => m.IsInWarrenty)
                    @Html.ValidationMessageFor(m => m.IsInWarrenty)
                </div>

                @*<div class="editor-label">
                    @Html.LabelFor(m => m.EnteredBy)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.EnteredBy)
                    @Html.ValidationMessageFor(m => m.EnteredBy)
                </div>*@
            </fieldset>
        </div>
        <div class="fieldsSection">
            <fieldset>
                <legend>Work Start Details</legend>

                <div class="editor-label">
                    @Html.LabelFor(m => m.WorkStartTime)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.WorkStartTime, new { @class = "dateTime", id = "WorkStartTime" })
                    <button id="setStartTimeButton">Set current time</button>
                    @Html.ValidationMessageFor(m => m.WorkStartTime)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(m => m.EstimateDeliveryTime)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.EstimateDeliveryTime, new { @class = "dateTime", id = "EstimateDeliveryTime" })
                    @Html.ValidationMessageFor(m => m.EstimateDeliveryTime)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(m => m.Technicion)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.Technicion)
                    @Html.ValidationMessageFor(m => m.Technicion)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(m => m.EnteredBy)
                </div>
                <div class="editor-field">
                    @Html.LabelFor(m => m.EnteredBy)
                    @Html.ValidationMessageFor(m => m.EnteredBy)
                </div>

            </fieldset>
        </div>
        <div class="fieldsSection">
            <fieldset>

                <div class="editor-label">
                    @Html.LabelFor(m => m.DeliveryTime)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.DeliveryTime, new { @class = "dateTime", id = "DeliveryTime" })
                    @Html.ValidationMessageFor(m => m.DeliveryTime)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(m => m.BillAmount)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.BillAmount)
                    @Html.ValidationMessageFor(m => m.BillAmount)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(m => m.CostAmount)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.CostAmount)
                    @Html.ValidationMessageFor(m => m.CostAmount)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(m => m.TimeSpent)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.TimeSpent)
                    @Html.ValidationMessageFor(m => m.TimeSpent)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(m => m.IssuesFound)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.IssuesFound)
                    @Html.ValidationMessageFor(m => m.IssuesFound)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(m => m.IssuesFixed)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.IssuesFixed)
                    @Html.ValidationMessageFor(m => m.IssuesFixed)
                </div>

            </fieldset>
        </div>
    </div>
    <p>
        <input type="submit" value="Create Service Booking" />
    </p>
        
}
